package Adapter

type IAdapter interface {
	SetSocket(socket ISocket)
}

type Adapter struct {
	IAdapter
	IPlug
	ISocket
}

type ChineseToAmericanAdapter struct {
	Adapter
}

type AmericanToChineseAdapter struct {
	Adapter
}

func (adapter *Adapter) SetSocket(socket ISocket) {
	adapter.ISocket = socket
}

func (adapter *ChineseToAmericanAdapter) GetVoltage() float32 {
	return adapter.ISocket.GetVoltage() * 0.5
}
func (adapter *AmericanToChineseAdapter) GetVoltage() float32 {
	return adapter.ISocket.GetVoltage() * 2
}
